package avicit.bdp.dds.remote.command.log;

import avicit.bdp.dds.remote.command.Command;
import avicit.bdp.dds.remote.command.CommandType;
import avicit.bdp.dds.remote.utils.FastJsonSerializer;

import java.io.Serializable;

/**
 *  roll view log response command
 */
public class RollViewLogResponseCommand implements Serializable {

    /**
     *  response data
     */
    private String msg;

    public RollViewLogResponseCommand() {
    }

    public RollViewLogResponseCommand(String msg) {
        this.msg = msg;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    /**
     * package response command
     *
     * @param opaque request unique identification
     * @return command
     */
    public Command convert2Command(long opaque){
        Command command = new Command(opaque);
        command.setType(CommandType.ROLL_VIEW_LOG_RESPONSE);
        byte[] body = FastJsonSerializer.serialize(this);
        command.setBody(body);
        return command;
    }
}
